<template>
  <div>
    <el-form-item :label="item.name" :rules="rules" v-if="!onlyDisplayField.includes(item.fieldType)">
      <slot></slot>
    </el-form-item>
    <slot v-else></slot>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
import { commonRule } from './rule/ruleConfig'
import { onlyDisplayField } from '../fieldType'
@Component({
  components: {
  }
})
export default class extends Vue {
  @Prop({ default: () => ({}) }) public item!: any
  @Prop({ default: '' }) public priorityAuthority!: string
  public get onlyDisplayField () {
    return onlyDisplayField
  }

  public get rules () {
    return commonRule(this.item)
  }
}
</script>

<style lang="stylus" scoped>
</style>
